﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace SAM.Framework.ExportData
{
    public class ExportOption<T,U>
    {
        /// <summary>
        /// 需要导出的列集合
        /// </summary>
        public IList<ColumnInfo> Columns { get; set; }

        /// <summary>
        /// 自定义格式化Func
        /// </summary>
        public Func<U, T, object> formatter { get; set; }

        /// <summary>
        /// 表单名称
        /// </summary>
        public string SheetName { get; set; }

        public ExportOption(string SheetName, IList<ColumnInfo> columns)
        {
            this.SheetName = SheetName;
            this.Columns = columns;
        }
    }

    public class ColumnInfo
    {
        /// <summary>
        /// 列头信息
        /// </summary>
        public string Text { get; set; }

        /// <summary>
        /// 列标识字段
        /// </summary>

        public string Key { get; set; }

        public ColumnInfo(string text, string key)
        {
            this.Text = text;
            this.Key = key;
        }
    }
}
